import {defineStore} from 'pinia'
import {ref} from 'vue'

export default defineStore('store1',()=>{
    let name=ref('')
    let avatar=ref('')
    let sex = ref(1)
    let sign= ref('')

    //存入用户数据
    function setInfo(data){
        name.value=data.name
        avatar.value=data.avatar
        sex.value=data.sex
        sign.value=data.sign
    }
    //重置用户信息
    function reset(){
        name.value = '';
        avatar.value = '';
        sex.value = 1;
        sign.value = '';
    }
    return{
        name,avatar,sex,sign,setInfo,reset
    }
})